<template>
    <transition name="fade">
    <div class="lse_loading_body" v-if="flag">
        <div class="lse_loading_content">
            <div>
                <CircleIview :percent="percentage" :stroke-color="color">
                    <Icon v-if="percentage === 100" type="ios-checkmark" size="60" style="color:#5cb85c"></Icon>
                    <span v-else style="font-size:24px">{{ percentage }}%</span>
                </CircleIview>
            </div>
            <div style="margin-top: 10px;" class="tips">{{msg}}</div>
        </div>
    </div>
    </transition>
</template>

<script>
export default {
  name: 'uploading',
  data () {
    return {
      flag: false,
      msg: 'uploading',
      percentage: 0
    }
  },
  computed: {
    color () {
      let color = '#2db7f5'
      if (this.percentage === 100) {
        color = '#5cb85c'
      }
      return color
    }
  },
  methods: {
    close () {
      this.flag = false
    }
  }
}
</script>

<style scoped>
.lse_loading_body{
    width: 100%;
    height: 100%;
    position: fixed;
    text-align: center;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000000;
}
.lse_loading_content{
    width: 100%;
    position: fixed;
    text-align: center;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}
</style>
